package org.jeecg.modules.demo.seal.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.seal.entity.Car;
import org.jeecg.modules.demo.seal.entity.CarBrandModel;
import org.jeecg.modules.demo.seal.entity.authOrg;

import java.util.List;

@Mapper public interface CarMapper extends BaseMapper<Car> {

    @Select("select org_id from auth_org where org_code like concat(#{orgCode}, '%')")
    List<Long> getOrgIds(String orgCode);

    @Select("select org_id from auth_org where org_code=#{orgCode}")
    Long getOrgId(String orgCode);

    @Select("select brand_model_id,brand,model from car_brand_model where brand_model_id=#{brandModelId}")
    CarBrandModel getBrandModel(long brandModelId);

    @Select("select org_name from auth_org where org_id = #{orgId}")
    String getDepartName(Integer orgId);

    @Select("select org_id,org_name,org_code from auth_org where org_name like concat('%', #{orgName}, '%')")
    List<authOrg> getOrg(String orgName);


}
